-
Notifications
You must be signed in to change notification settings - Fork 506
Specifiy json_decode
default return type
#1283
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Specifiy json_decode
default return type
#1283
Conversation
b31db0e
to
d43c845
Compare
I've rejected this idea in phpstan/phpstan-nette#89 (comment) and that's why I suggested to subtract from MixedType instead. |
ah I see, makes sense. ok then |
I always forget that adding more type information / getting rid of mixed will potentially lead to more errors below level 9. I instinctively want to get rid of mixed everywhere :D |
@herndlm
like I changed in AccessPropertiesRule with additional check for object? I think.
It's just not fixed yet :) |
I'll send a pull request for it! |
ok sounds interesting, just don't spend too much time on the json_decode case. since mixed or mixed~stdClass is returned it might not work. but that's fine :) |
My assumption was not correct...
I'm not gonna try it now... |
so, in case of |
mixed
is too vague IMO, this should be fine to specify with more details, see also https://3v4l.org/hEDjaBut please somebody double and triple check that I didn't miss anything here. Together with #993 this allows us to get rid of
stdClass
for example.I was also hoping that it would "fix" phpstan/phpstan#7073 but apparently
NonexistentOffsetInArrayDimFetchRule
is not happy with scalar null coalescing access. But not sure if that's coming from that rule or somewhere else CC @rajyan